package com.ccn.crm.service.impl;

import com.ccn.crm.mapper.ProductMapper;
import com.ccn.crm.model.Product;
import com.ccn.crm.service.IProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.events.Event;

import java.util.List;

@Service
public class ProductServiceImpl implements IProduct {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public Product getProductById(Integer id) {
        Product product = productMapper.selectByPrimaryKey(id);
        return product;
    }

    @Override
    public int insertData(Product product) {
        int count = productMapper.insert(product);
        return count;
    }

    @Override
    public int selectOrder() {
        return productMapper.selectOrder();
    }

    @Override
    public Product selectByName(String name) {
        return productMapper.selectByName(name);
    }

    @Override
    public Product selectByCrmPid(String crmPid) {
        return productMapper.selectByCrmPid(crmPid);
    }

    @Override
    public List<Product> selectPush() {
        return productMapper.selectPush();
    }

    @Override
    public int updateProjectStatus(int id) {
        return productMapper.updateProjectStatus(id);
    }

    @Override
    public int updateByCrmPid(Product record) {
        return productMapper.updateByCrmPid(record);
    }

    @Override
    public List<Product> selectNotCrmId() {
        return productMapper.selectNotCrmId();
    }

    @Override
    public int updateProjectcrmId(Integer id, String crmPid) {
        return productMapper.updateProjectcrmId(id,crmPid);
    }

    @Override
    public List<Product> selectNotSentProduct() {
        return productMapper.selectNotSentProduct();
    }

    @Override
    public int updatePoId(String po, int id) {
        return productMapper.updatePoId(po,id);
    }

    @Override
    public List<Product> selectcCreateProduct() {
        return productMapper.selectcCreateProduct();
    }

}
